#include <Keypad.h>

const byte ROWS = 4; // Four rows
const byte COLS = 4; // Four columns
char pwd="0";
unsigned int zt=0;

//Define the keymap
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};

//// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte rowPins[ROWS] = {6,7,8,9};

// Connect keypad COL0, COL1, COL2 and COL3 to these Arduino pins.
byte colPins[COLS] = {2,3,4,5}; //connect to column pinouts

// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
   Serial.begin(9600);
}

void loop(){
   char key = keypad.getKey();

   if (key != NO_KEY){
   Serial.println(key);
   if (key=="*"){
    zt=1;
    if (pwd!=0){
      if (pwd=="020207979"){
        run
      }else{
        
      }
   if (zt==1){
    switch(key){
      case "1":
        strcat(pwd,key);
        break;
      case "1":
        strcat(pwd,key);
        break;
      case "1":
        strcat(pwd,key);
        break;
      case "1":
        strcat(pwd,key);
        break;
      case "1":
        strcat(pwd,key);
        break;
    }
   }
      }
     }
   }
}
